function product(arr){
    let result=arr.result=arr.reduce(function(x,y){
        return x*y;
    })

    return result;
}

if (product([1,2,3,4]) ===24  && product([0,1,2]) ===0  && product([55,66,77,88]) ===24596880 ){
    console.log('测试通过');

   }
   else{
    console.log('测试失败');

   }


   
let f=function(x){
    return x%3===0;

}
let arr=['a','','bb','',"    ",'aa']

let newarr=arr.filter(f)

console.log(newarr);
console.log(arr);